package com.daona.job.flow.component;

import com.daona.infrastructure.minio.MinioUtils;
import com.daona.job.flow.context.PdfContext;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.RequiredArgsConstructor;

@LiteflowComponent
@RequiredArgsConstructor
public class UploadPdf extends NodeComponent {

    private final MinioUtils minioUtils;

    @Override
    public void process() throws Exception {
        PdfContext context = this.getRequestData();
        minioUtils.uploadFile(context.getBucketName(), context.getFileName(), context.getFilePath());
    }
}
